﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/SiteContent.Master" AutoEventWireup="true"
    CodeBehind="Init.aspx.cs" Inherits="Warehouse.Web.Inventory.Init" %>

<%@ Import Namespace="Warehouse.DataAccess" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .modulecontent li h2 {
            background: #ccf;
            padding-left: 10px;
        }
        .datatable {
            width: 100%;
        }
        .col_category {
            background: #ccf;
            text-align: center;
        }
        .col_category input {
            float: right;
            margin: 0 5px;
        }
        .col_category .categoryname {
            font-weight: bold;
        }
        .col_product_sn {
            width: 40px;
        }
        .col_product_name {
        }
        .col_spec_spec {
            width: 50px;
            text-align: center;
        }
        .col_spec_parkingspec {
            width: 50px;
            text-align: center;
        }
        .col_spec_unit {
            width: 30px;
            text-align: center;
        }
        .col_spec_count {
            width: 60px;
        }
        .col_spec_count input {
            width: 60px;
            border: none;
            height: 26px;
            background: transparent;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="moduleheader">
        <h4>
            初始化库存</h4>
        <div class="moduleheadertoolbar">
            <label>
                仓库
                <asp:DropDownList ID="ddlWareHouse" runat="server" DataTextField="Name" DataValueField="ID"
                    field="HouseID">
                </asp:DropDownList>
            </label>
            <asp:Button ID="btnView" runat="server" Text="查看" CssClass="ui-button" OnClick="btnView_Click" />
            <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="ui-button" OnClick="btnSave_Click" />
        </div>
    </div>
    <div class="modulecontent">
        <asp:HiddenField ID="hdHouseID" runat="server" />
        <table id="tablecategories" class="datatable">
            <tr>
                <th class="col_product_sn">
                    编号
                </th>
                <th class="col_product_name">
                    产品
                </th>
                <th class="col_spec_spec">
                    规格
                </th>
                <th class="col_spec_parkingspec">
                    包装规格
                </th>
                <th class="col_spec_unit">
                    单位
                </th>
                <th class="col_spec_count">
                    数量
                </th>
            </tr>
            <asp:Repeater ID="rptCategories" runat="server" OnItemDataBound="rptCategories_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td class="col_category" colspan="6">
                            <span class="categoryname" categoryid="<%# Eval("ID") %>">
                                <%#Eval("Name")%></span>
                        </td>
                    </tr>
                    <asp:Repeater ID="rptProducts" runat="server">
                        <ItemTemplate>
                            <tr>
                                <asp:PlaceHolder ID="PlaceHolder1" runat="server" Visible='<%# Eval("FirstProduct") %>'>
                                    <td class="col_product_sn" rowspan='<%#Eval("ProductSpecificatoinCount")%>'>
                                        <%#Eval("Product.SerialNumber")%>
                                    </td>
                                </asp:PlaceHolder>
                                <asp:PlaceHolder ID="PlaceHolder2" runat="server" Visible='<%# Eval("FirstSpecification") %>'>
                                    <td class="col_product_name" rowspan='<%#Eval("SpecificatoinCount") %>'>
                                        <%#Eval("Product.Name")%>&nbsp;&nbsp;&nbsp;&nbsp;<%#Eval("Product.Grade")%>&nbsp;&nbsp;&nbsp;&nbsp;<%#Eval("Product.Model")%><br />
                                        <%#Eval("Product.Description")%>
                                    </td>
                                </asp:PlaceHolder>
                                <td class="col_spec_spec">
                                    <%# Eval("Specification.Specification")%>
                                </td>
                                <td class="col_spec_parkingspec">
                                    <%# Eval("Specification.PackagingSpecification")%>
                                </td>
                                <td class="col_spec_unit">
                                    <%# Eval("Specification.Unit")%>
                                </td>
                                <td class="col_spec_count">
                                    <asp:PlaceHolder ID="PlaceHolder3" runat="server" Visible='<%# Eval("Specification")!=ProductSpecification.Empty %>'>
                                        <input type="text" field="Count" name="Specification_<%# Eval("Specification.ID")%>"
                                            value="<%# Eval("Count")%>" />
                                    </asp:PlaceHolder>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </ItemTemplate>
            </asp:Repeater>
        </table>
    </div>
</asp:Content>
